<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
		        .active {
		            background: orange;
		        }
		    </style>
	</head>
	<body>
		<button id="btn1">按钮1</button>
		    <button id="btn2" class="abc def">按钮2</button>
		    <button>按钮3</button>
		    <button>按钮4</button>
		<script type="text/javascript">
			//给js元素添加class名
			//给元素添加类名  元素.className = 'class名'
			btn1.className='active';
			
			//移出class名
			btn1.className = '';
			
			
			 
			
		</script>
	</body>
</html>
